#ifndef DBTABRECORDCLASS_H
#define DBTABRECORDCLASS_H

#include <QObject>
#include "dbtabbase.h"

class DBTabRecordClass:public DBTabBase
{
public:
    static DBTabRecordClass* getDBTab(){
        static DBTabRecordClass tab;
        return &tab;
    }

    static const ColumnInfo mColumnTab[];
    static const QLatin1String TAB_NAME;
    static const char* _UUID;
    static const char* _DATE;
    static const char* _TIME;
    static const char* _RECORD_NO;
    static const char* _PRODUCT_NAME;
    static const char* _BARCODE;
    static const char* _PRODUCT_BRAND;
    static const char* _NET;
    static const char* _TARE;
    static const char* _GROSS;
    static const char* _RANGE;
    static const char* _CHKRESULT;
    static const char* _USER;

    enum{
        INDEX_ID,
        INDEX_UUID,
        INDEX_DATE,
        INDEX_TIME,
        INDEX_RECORD_NO,
        INDEX_PRODUCT_NAME,
        INDEX_BARCODE,
        INDEX_PRODUCT_BRAND,
        INDEX_NET,
        INDEX_TARE,
        INDEX_GROSS,
        INDEX_RANGE,
        INDEX_CHKRESULT,
        INDEX_USER,
        INDEX_END
    };

    void createTab(QSqlDatabase &db);
    static const char *getColumnName(int index);
private:
    DBTabRecordClass();
};

#endif // DBTABRECORDCLASS_H
